package com.yj_app.qualitytest.base;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.rengwuxian.materialedittext.MaterialAutoCompleteTextView;

public class BaseFragment extends Fragment {
   public BaseActivity baseActivity;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseActivity= (BaseActivity) getActivity();
    }

    public View rootView;
    public void setRecyclerViewManager(RecyclerView myRecy) {
        myRecy.setLayoutManager(new LinearLayoutManager(getContext()));
    }
    public void showDropDown(MaterialAutoCompleteTextView textView){
        textView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if(hasFocus){//获取焦点时
                    textView.showDropDown();
                }
            }
        });
    }
}
